﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CApAPPOptimizeClearanceCommand
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.AutomaticPathPlanner;
using DnProcessSimulateCommands.AutomaticPathPlanner.Planner;
using EngineeringInternalExtension;
using System.Collections.Generic;


namespace DnProcessSimulateCommands;

public class CApAPPOptimizeClearanceCommand(
  List<CApAPPTask> i_tasks,
  KiAppPathPlanningParamsEx i_pathPlanningParams) : CApAPPPlanCommand(i_tasks, i_pathPlanningParams, false, false)
{
  internal override CApAPPSegmentPlanCommand DoCreateThreadCommand(
    CApAPPSubTask i_subtask,
    KiAppPathPlanningParamsEx i_pathPlanningParams,
    bool i_optimize)
  {
    return (CApAPPSegmentPlanCommand) new CApAPPSegmentOptimizeClearanceCommand(i_subtask, i_pathPlanningParams);
  }

  protected override bool DoStart(
    ref CApAPPPlanCommandBase.PlanSuccessEventArgs errEvtArgs)
  {
    if (this.PathPlanningParams.CollisionSetDesiredClearances.Length != 0)
      return base.DoStart(ref errEvtArgs);
    this.NotifyEndPlanning((object) this, new CApAPPPlanCommandBase.PlanSuccessEventArgs(false, CApAPPMainWindowStringTable.NoCollisionSetErrorTitle, CApAPPMainWindowStringTable.NoCollisionSetErrorMsg));
    return false;
  }
}
